<?php

/*
 * jzp2008
 */

namespace app\admin\controller;

/**
 * Description of Model
 *
 * @author jzp
 */
class Model extends Common {

    //put your code here
    public function index() {
        return 'index';
    }

    public function modellist() {
        $model = model('Modellist');
        $modellist = $model->select();
        $this->assign('modellist',$modellist);
        return view();
    }
    
    public function update() {
        if(!input('mid')){
            $this->error('参数错误');
        };
        $mid = input('mid');
        $modelatt = model('model_att');
        $modelattlist = $modelatt->where("mid='0' or mid ='$mid'")->select();
        
        $this->assign('mid',$mid);
        $this->assign('modelattlist',$modelattlist);
        return view();
    }
    
    public function addattr() {
        if(!input('mid')){
            $this->error('参数错误');
        };
        
        $mid = input('mid');
        $modelatt = model('model_att');
        
        
        $this->assign('mid',$mid);
        return view();
    }

}
